package com.csu.device.dao;

import com.alibaba.fastjson.JSONArray;
import com.csu.device.entity.DeviceBinding;
import com.csu.device.entity.DeviceRela;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface DeviveDao {

    public Integer addDeviceBinding(DeviceBinding deviceBinding);

    public Integer updateDeviceBinding(DeviceBinding deviceBinding);

    public Integer deleteDeviceBinding(DeviceBinding deviceBinding);

    public Integer addDeviceRela(DeviceRela deviceRela);

    public Integer updateDeviceRela(DeviceRela deviceRela);

    public Integer deleteDeviceRela(DeviceBinding deviceBinding);

    //查询
    public List<Map<String,Object>> findDeviceBinding(Map<String, Object> map);
    public int findDeviceBindingCount(Map<String, Object> map);
    public List<Map<String,Object>> findRela(Map<String, Object> map);

    public String getSn(DeviceBinding deviceBinding);

    public Integer getId(DeviceBinding deviceBinding);

    public List<String>  allUserId();


    /**
     * 根据json获取设备使用时长
     */
    public List<Map<String,Object>> findAllDevice(Map<String,Object> map);


    public List<Map<String,Object>> findBtype();
}
